home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / KEYBOARD.SWG / 0072_Asm access to Keyboard.pas < prev    next >
Pascal/Delphi Source File  |  1994-02-03  |  789b  |  35 lines

  1. {
  2. From: IAN LIN
  3. Subj: keyboard buffer
  4. ---------------------------------------------------------------------------
  5.  TH> How do you write TO the keyboard buffer.
  6.  
  7. These are all procedures. You could easily rewrite them to be functions or
  8. write functions that call these and use them.
  9.  
  10. High byte is scan code, low byte is character.
  11. }
  12.  
  13. Procedure putkey(key:word);
  14.  assembler; {PUTKEY}
  15.  asm; mov ah,5; mov cx,key; int 16h;
  16. end;
  17.  
  18.  
  19. {To find out what ones belong to each key (E is for enhanced; the other will
  20. filter enhanced keys): }
  21.  
  22. Procedure egetkey(Var key:word);
  23. Var tmp:word;
  24. Begin
  25.  asm; mov ah,10h; int 16h; mov tmp,ax; end;
  26.  key:=tmp;
  27. end;
  28.  
  29. Procedure getkey(Var key:word);
  30. Var tmp:word;
  31. Begin
  32.  asm; xor ah,ah; int 16h; mov tmp,ax; end;
  33.  key:=tmp;
  34. end;
  35.